﻿using System.Collections.Generic;
using System.Linq;
using Fee.Stores;

namespace Identity.Stores.Ef
{
    public class DistrictStore<T> : IDistrictStore<T> where T : MemberDbContextBase
    {
        private readonly T _context;

        public DistrictStore(T context)
        {
            _context = context;
        }

        public District GetById(int id)
        {
            return _context.Districts.FirstOrDefault(_ => _.Id == id);
        }

        public IEnumerable<District> List()
        {
            return _context.Districts;
        }
    }
}